home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Blender 2.49b / blender-2.49b-windows.exe / $_4_ / .blender / scripts / colladaExport14.py < prev    next >
Text File  |  2009-08-31  |  4KB  |  123 lines

  1. #!BPY
  2.  
  3. """
  4. Name: 'COLLADA 1.4(.dae) ...'
  5. Blender: 241
  6. Group: 'Export'
  7. Tooltip: 'Export scene from Blender to COLLADA 1.4 format (.dae)'
  8. """
  9.  
  10. __author__ = "Illusoft - Pieter Visser"
  11. __url__ = ("Project homepage, http://colladablender.illusoft.com")
  12. __version__ = "0.3.160"
  13. __email__ = "colladablender@illusoft.com"
  14. __bpydoc__ = """\
  15.  
  16. Description: Exports a Blender scene into a COLLADA 1.4 file.
  17.  
  18. Bugs and Features: check the project website: http://colladablender.illusoft.com
  19.  
  20. Usage: Run the script from the menu or inside Blender. 
  21. """
  22.  
  23. # --------------------------------------------------------------------------
  24. # Illusoft Collada 1.4 plugin for Blender
  25. # --------------------------------------------------------------------------
  26. # ***** BEGIN GPL LICENSE BLOCK *****
  27. #
  28. # Copyright (C) 2006: Illusoft - colladablender@illusoft.com
  29. #
  30. # This program is free software; you can redistribute it and/or modify
  31. # it under the terms of the GNU General Public License as published by
  32. # the Free Software Foundation; either version 2 of the License,
  33. # or (at your option) any later version.
  34. #
  35. # This program is distributed in the hope that it will be useful,
  36. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  37. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    See the
  38. # GNU General Public License for more details.
  39. #
  40. # You should have received a copy of the GNU General Public License
  41. # along with this program; if not, write to the Free Software Foundation,
  42. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  43. #
  44. # ***** END GPL LICENCE BLOCK *****
  45. # --------------------------------------------------------------------------
  46.  
  47. import sys
  48. ##import os
  49. import Blender
  50.  
  51. error = False
  52.  
  53. ######################## SET PATH TO FOLDER consisting 'colladaImEx' here (if necessary)
  54.     
  55. # Example:
  56.    
  57. # scriptsDir = "C:/Temp/"
  58.    
  59. scriptsDir = ""
  60. #############################################################################
  61.  
  62. try:
  63.     import colladaImEx.cstartup
  64.     if not Blender.Get('scriptsdir') and not Blender.Get('uscriptsdir'):
  65.         if scriptsDir == '' or scriptsDir is None:
  66.             Blender.Draw.PupMenu("Cannot find folder %t | Please set path in file 'colladaImport14.py'")
  67.             error = True
  68.         else:
  69.             loc = scriptsDir
  70.     else:
  71.         loc = ""
  72. except ImportError:
  73.     # Check if full version of python is installed:
  74.     try:
  75.         import os
  76.         pythonFull = True
  77.     except ImportError:
  78.         pythonFull = False
  79.     
  80.     if not pythonFull:
  81.         from sys import version_info
  82.         version = '%s.%s' % version_info[0:2]
  83.         print """
  84. This script requires the xml module that is part of a
  85. default standalone Python install.
  86.  
  87. To run the collada importer and exporter you need to have
  88. Python version %s installed in your system. It can be downloaded from:
  89.  
  90. http://www.python.org
  91.  
  92. Notes:
  93. - The minor (third) version number doesn't matter, you can have either
  94. Python %s.1 or %s.2 or higher.
  95. - If you do have Python %s installed and still can't run the scripts, then
  96. make sure Blender's Python interpreter is finding the standalone modules
  97. (run 'System Information' from Blender's Help -> System menu).
  98. """ % (version, version, version, version)
  99.         Blender.Draw.PupMenu("Please install full version of python %t | Check the console for more info")
  100.         error = True
  101.     else:    
  102.         if scriptsDir == "":
  103.             Blender.Draw.PupMenu("Cannot find folder %t | Please set path in file 'colladaImport14.py'")
  104.             error = True
  105.         else:
  106.             if scriptsDir not in sys.path:
  107.                 sys.path.append(scriptsDir)
  108.             try:
  109.                 import colladaImEx.cstartup
  110.                 loc = scriptsDir
  111.             except:
  112.                 Blender.Draw.PupMenu("Cannot find colladaImEx files %t | Please make sure the path is correct in file 'colladaImport14.py'")
  113.                 error = True
  114. except StandardError:
  115.     error = True
  116.             
  117. if not error:         
  118.     try:
  119.         reload(colladaImEx.cstartup)
  120.         colladaImEx.cstartup.Main(False, loc)
  121.     except ImportError:
  122.         pass
  123.